package com.oig.base.api;

import com.oig.base.api.factory.CountryServiceFallBackFactory;
import com.oig.common.module.SysRequest;
import com.oig.sys.base.dto.CountryDto;
import com.oig.sys.base.vo.CountryVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(contextId="countryService",value="sys-base-server",path="/country",fallbackFactory= CountryServiceFallBackFactory.class)
public interface CountryService {

    @PostMapping(value = "/getCountryByCode/{code}")
    CountryVo getCountryByCode(@PathVariable(value = "code") String code);

    @PostMapping(value = "/getCountryByApplyCode/{applyCode}")
    CountryVo getCountryByApplyCode(@PathVariable(value = "applyCode") String applyCode);

    @PostMapping(value = "/findCountriesByApplyCodes")
    List<CountryVo> findCountriesByApplyCodes(@RequestBody List<String> applyCodeList);

    @PostMapping(value = "/findCountriesByNames")
    List<CountryVo> findCountriesByNames(@RequestBody List<String> nameList);

    @PostMapping(value = "/getCountryByName/{name}")
    CountryVo getCountryByName(@PathVariable(value = "name") String name);

    // 获取国家list
    @PostMapping(value = "/findCountry")
    List<CountryVo> findCountry(@RequestBody SysRequest<CountryDto> countryRequest);

}
